//package test;
//
//import com.cheguo.cgtrade.annotations.JsrValidate;
//import org.hibernate.validator.internal.engine.ConstraintViolationImpl;
//import org.hibernate.validator.internal.engine.path.PathImpl;
//
//import javax.validation.*;
//import javax.validation.constraints.Min;
//import javax.validation.constraints.NotNull;
//import java.util.ArrayList;
//import java.util.List;
//import java.util.Set;
//
///**
// * @author zhangweifeng
// * @date 2018/6/1
// */
//
//@JsrValidate
//public class M {
//
//    @NotNull
//    @Min(1)
//    private Integer i;
//
//    public Integer getI() {
//        return i;
//    }
//
//    public void setI(Integer i) {
//        this.i = i;
//    }
//
//    public static void main(String[] args) {
//        M a = new M();
//        a.i=0;
//        java.lang.Object m="1";
//        System.out.println(m.getClass().isAnnotationPresent(JsrValidate.class));
//        ValidatorFactory validatorFactory = Validation.buildDefaultValidatorFactory();
//        Validator validator = validatorFactory.getValidator();
//        Set<ConstraintViolation<Integer>> constraintViolations = validator.validate(1);
//        List<String> messageList = new ArrayList<>();
//        for (ConstraintViolation<Integer> constraintViolation : constraintViolations) {
//            ConstraintViolationImpl  constraintViolation1= (ConstraintViolationImpl) constraintViolation;
//            String field=((PathImpl) constraintViolation1.getPropertyPath()).getLeafNode().getName();
//            System.out.println(field+constraintViolation.getMessage());
//        }
//    }
//}
